Forward
MockMotor can save you time in a few scenarios where you already have a working implementation of a backend service.
You may need to:
Modify only some of the reactions, letting the rest come from the real backend
Add a response that is planned but not yet implemented in the backend
Preserve the backend responses in anticipation of its lease time ending
In all of these scenarios, you can add a forwarding URL to the MockMotor service. If none of the reactions match the request, MockMotor calls the forwarding URL and obtains the response from there.
Configuring the Forwarding URL
In the mock service configuration, provide the Forwarding URL.
MockMotor passes the payload, relative URL, query string, and HTTP headers to the backend as-is.
Do not enable mock recording unless you want MockMotor to save the transactions for reference.
Backend Authentication
If the backend requires authentication, make sure you call mock service with the same authentication
data (for example, the Authorization
header). When the mock service calls the forwarding URL with these data,
the backend is expected to permit the access.
Two-Way SSL is not supported
One notable unsupported feature is the two-way SSL authentication. The current version of MockMotor doesn’t let you set a custom certificate for identification. That may be implemented in future versions; please let me know if you need it.
Recording the Transactions
You can tell MockMotor to record the traffic for which it has no matching reactions.
All it takes is to trigger the Save Transactions
radio button into Yes
position.
MockMotor saves all the forwarded transactions under the service Recorded
tab. You can download them from there to use
as a reference for creating new mocks.